package com.hargasembako.core.entity;

import java.util.HashSet;
import java.util.Set;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.hargasembako.core.util.SearchJanitor;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Brand {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) 
	private Long id;	
	@Persistent
	private String name;	
    @Persistent
    private Set<String> fts;
    
	public Brand (String name){
		this.name = name;
		this.fts = new HashSet<String>();
        
        SearchJanitor.updateFTSStuff(this.toString(), this.fts);		
	}
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Set<String> getFts() {
		return fts;
	}

	public void setFts(Set<String> fts) {
		this.fts = fts;
	}

	public String toString(){
		return this.name;
	}

}
